﻿using Colorful.Furniture.CommonDto;
using Colorful.Furniture.Extensions;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Text;
using Newtonsoft.Json;

namespace Colorful.Furniture.ErpCustomerManagement;


/// <summary>
///  客户分页输入体
/// </summary>
public class CustomerInputDto : PageInputDto
{
    /// <summary>
    /// 关键字搜索
    /// </summary>
    public string Keyword { get; set; }

    /// <summary>
    /// 客户名称
    /// </summary>
    public string Name { get; set; }

    /// <summary>
    /// 状态（0：禁用；1：启用）
    /// </summary>
    public int? Status { get; set; }

    /// <summary>
    /// 客户编号
    /// </summary>
    public int? Code { get; set; }

    /// <summary>
    ///  类别
    /// </summary>
    public int? Type { get; set; }

}

/// <summary>
/// 客户状态输入体
/// </summary>
public class CustomerStatesInputDto
{
    /// <summary>
    /// 客户id
    /// </summary>
    public List<Guid?> Id { get; set; }

    /// <summary>
    ///  客户状态（禁用和启用）
    /// </summary>

    public int StateType { get; set; }
}


/// <summary>
///  保存信息
/// </summary>
public class SaveCustomerInputDto : CreateCustomerInputDto
{
    /// <summary>
    ///  id
    /// </summary>
    public Guid? Id { get; set; }

}


/// <summary>
///  创建客户输入体
/// </summary>
public class CreateCustomerInputDto
{
    /// <summary>
    /// 客户名称
    /// </summary>
    [Required(ErrorMessage = "【客户名称】不能为空")]
    public string Name { get; set; }

    /// <summary>
    /// 客户编号
    /// </summary>
    public int? Code { get; set; }

    /// <summary>
    /// 登录名
    /// </summary>
    public string LoginName { get; set; }

    /// <summary>
    /// 客户座机
    /// </summary>
    public string Phone { get; set; }

    /// <summary>
    ///  类别
    /// </summary>
    public Guid? Type { get; set; }

    /// <summary>
    ///  备注
    /// </summary>
    public string Remark { get; set; }

    /// <summary>
    /// 所属销售人员（多个名字用,符号分割）
    /// </summary>
    [JsonIgnore]
    public string SalesPerson => SalesPersonList.GenericToString();

    /// <summary>
    ///  所属销售人员-名字集合
    /// </summary>
    public List<string> SalesPersonList { get; set; }

    /// <summary>
    /// 账户余额
    /// </summary>
    public decimal? Price { get; set; }

    /// <summary>
    /// 初始授信额度
    /// </summary>
    public decimal? CreditPriceInitial { get; set; }

    /// <summary>
    ///  排序字段：值越大越靠前
    /// </summary>
    public long Sort { get; set; }

    /// <summary>
    /// 每日可充值单数
    /// </summary>
    public int? RechargeNumberByDay { get; set; }

}

